bazel_dep(name = "buildifier_prebuilt", version = "7.3.1")
bazel_dep(name = "gazelle", version = "0.40.0")
bazel_dep(name = "rules_go", version = "0.50.1")
bazel_dep(name = "rules_proto", version = "6.0.2")

# Rulegen deps
rulegen_go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
rulegen_go_deps.module(
    path = "github.com/urfave/cli",
    sum = "h1:wYSSj06510qPIzGSua9ZqsncMmWE3Zr55KBERygyrxE=",
    version = "v1.21.0",
)
use_repo(rulegen_go_deps, "com_github_urfave_cli")

# Local overrides
bazel_dep(name = "rules_proto_grpc", version = "0.0.0.rpg.version.placeholder")
local_path_override(
    module_name = "rules_proto_grpc",
    path = "modules/core",
)

bazel_dep(name = "rules_proto_grpc_example_protos", version = "0.0.0.rpg.version.placeholder")
local_path_override(
    module_name = "rules_proto_grpc_example_protos",
    path = "modules/example_protos",
)

# Buf
bazel_dep(name = "rules_proto_grpc_buf", version = "0.0.0.rpg.version.placeholder")
local_path_override(
    module_name = "rules_proto_grpc_buf",
    path = "modules/buf",
)

# C
bazel_dep(name = "rules_proto_grpc_c", version = "0.0.0.rpg.version.placeholder")
local_path_override(
    module_name = "rules_proto_grpc_c",
    path = "modules/c",
)

bazel_dep(name = "protobuf", version = "27.1")

# C++
bazel_dep(name = "rules_proto_grpc_cpp", version = "0.0.0.rpg.version.placeholder")
local_path_override(
    module_name = "rules_proto_grpc_cpp",
    path = "modules/cpp",
)

bazel_dep(name = "toolchains_protoc", version = "0.3.1")

# Prevent version skew by matching protoc version to protobuf version, as C++ is the only lang that
# has no cross-version runtime guarantee:
# https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp
protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc")
protoc.toolchain(
    google_protobuf = "com_google_protobuf",
    version = "v27.1",
)

# Documentation
bazel_dep(name = "rules_proto_grpc_doc", version = "0.0.0.rpg.version.placeholder")
local_path_override(
    module_name = "rules_proto_grpc_doc",
    path = "modules/doc",
)

# Go
bazel_dep(name = "rules_proto_grpc_go", version = "0.0.0.rpg.version.placeholder")
local_path_override(
    module_name = "rules_proto_grpc_go",
    path = "modules/go",
)

# gRPC-Gateway
bazel_dep(name = "rules_proto_grpc_grpc_gateway", version = "0.0.0.rpg.version.placeholder")
local_path_override(
    module_name = "rules_proto_grpc_grpc_gateway",
    path = "modules/grpc_gateway",
)

# Java
bazel_dep(name = "rules_proto_grpc_java", version = "0.0.0.rpg.version.placeholder")
local_path_override(
    module_name = "rules_proto_grpc_java",
    path = "modules/java",
)

# Objective-C
bazel_dep(name = "rules_proto_grpc_objc", version = "0.0.0.rpg.version.placeholder")
local_path_override(
    module_name = "rules_proto_grpc_objc",
    path = "modules/objc",
)

# Python
bazel_dep(name = "rules_proto_grpc_python", version = "0.0.0.rpg.version.placeholder")
local_path_override(
    module_name = "rules_proto_grpc_python",
    path = "modules/python",
)

bazel_dep(name = "rules_python", version = "0.37.2")

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(python_version = "3.11")
